<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        #box1{
            width: 500px;
            height: 500px;
            background-color:antiquewhite;
        }
        #box2{
            width: 300px;
            height: 300px;
            background-color:rgb(157, 230, 63);
        }
        #box3{
            width: 200px;
            height: 200px;
            background-color:rgb(137, 126, 211);
        }
    </style>
    <script>
        window.onload = function(){
            var box1 = document.getElementById('box1');
            var box2 = document.getElementById('box2');
            var box3 = document.getElementById('box3');
            box1.addEventListener('click',function(){
                alert('box1');
            },true);
            box2.addEventListener('click',function(){
                alert('box2');
            },true);
            box3.addEventListener('click',function(){
                alert('box3');
            },true);
        }
    </script>
</head>
<body>
    <div id="box1">
        <div id="box2">
            <div id="box3"></div>
        </div>
    </div>
</body>
</html>